Skip to content

test(qt): verify DSR 6n reply chain through Qt write-back to real child (#28) - #331

Merged
JavaZeroo merged 4 commits into
mainfrom
agent/query-reply-contract-db104bbf1b21
Nov 8, 2026
Merged

JavaZeroo merged 4 commits into
mainfrom
agent/query-reply-contract-db104bbf1b21

Conversation

@JavaZeroo-Bot

@JavaZeroo-Bot JavaZeroo-Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

范围(#28 回复合同调查切片)

在正式 C++ / Qt Widgets / 随包固定 Microsoft ConPTY 路径上,用一个有界、确定的单会话场景核实「核心回复 → Qt 回写 → 真实 child 收到字节」的分层证据,并区分核心孤立合同、ConPTY 原始传输、Qt 产品回写与 child 实际接收。只调查已实现的 DSR CSI 6n;不修改产品行为/默认入口、不新增查询支持、不进入 #28 整体 TUI 验收、不关闭 #28/#7。

固定场景:80×24 主屏、单会话、无 resize/备用屏/滚动区;child 从 home 写 AB 后发 ESC[6n(源 41421b5b366e)。独立预期来自既有核心 reply 合同(experiments/core/reply_test.cpp:1 基 ESC[row;colR,同一测试断言 ab+ESC[6n → ESC[1;3R),即 1b5b313b3352。

交付

  • 新增 src/qt/query_reply_test.cpp + CTest qt_query_reply:同一可执行文件以 --query-child 重入作为独立 child,启用 UTF-8/VT 输入输出模式,只写固定源并记录实际收到的原始字节 + metadata;不调用可能触发 conhost 光标同步的 API。
  • 三个分层阶段:
    1. raw-silent:固定 ConPTY + host 不回复 → child 接收为空并自身超时(exit 42),说明 conhost 不代答;
    2. raw-distinct:host 写入 ESC[9;9R → child 原样收到,证明 host→ConPTY→child 写入路径;
    3. product:正式 SessionModel 解析 transport 的固定源串起点 23(AB+ESC[6n;ESC[6n 从零基字节 25 开始)的查询并经同一有界输入队列回写 → child 恰收 ESC[1;3R。
  • 结果与身份:experiments/shell/results/2026-11-09-qt-query-reply/README.md、validation.json;docs/EVIDENCE.md 索引行;对 Vim 轨迹中「conhost 代答」旧括注加后续修正指向(保留原记录)。

实测(实现提交后的干净工作树,两次运行)

run product child PID product 接收 raw-silent raw-distinct job_after
1 16284 1b5b313b3352 空/42 1b5b393b3952/0 {active:0,total:8,terminated:0}
2 13780 1b5b313b3352 空/42 1b5b393b3952/0 {active:0,total:8,terminated:0}

产品层:transport = 启动包 ESC[1t ESC[c ESC[?1004h ESC[?9001h(23 B)+ AB+ESC[6n + 关闭序列(零基偏移:固定源串从 23 开始,AB 在 23/24,ESC[6n 从 25 开始);core 行 0 = AB、协议光标 (0,2);natural_exit/cleanup_verified/output_eof=true、active_after=0、PID 与 resize_state().child_pid 一致;child raw 与 metadata 交叉一致。启动包 DA1 请求未产生回写(child 精确等于 DSR 回复,未收到 ESC[?6c)。

验证

  • ctest -R '^qt_query_reply$':Passed 4.34 s
  • reply_core:Passed 0.01 s;private_mode_core:Passed 0.02 s(已有核心合同/DA1 strict-recovery 差异复跑)
  • pinned ConPTY 1.25.260930003;Qt 6.10.3 offscreen;MSVC 19.42.34433.0;presented_done=null

限制

仅单一固定主屏/位置/会话,不含 resize、备用屏、滚动区、Unicode、历史/选择/Find;只覆盖 DSR 6n,DA1 仍 strict-only/recovery-silent,DA2/OSC/括号粘贴未改变;child 启用 ENABLE_VIRTUAL_TERMINAL_INPUT(pinned ConPTY 透传未处理 CSI 的条件),未测非 VT 输入 child;未与 WindTerm 原版对照,未验证真实 TUI 消费回复;#28 TUI 矩阵与 #27/#29/#30 联合验收仍开放。

不启用自动合并,不请求 Codex review,不关闭 #28/#7。

JavaZeroo-Bot and others added 3 commits November 9, 2026 00:33
…ld (#28)

Add a bounded, test-only layered fixture for the implemented cursor-position query reply on the formal C++/Qt/fixed-ConPTY path. The fixed scenario writes two printable ASCII cells from home and asks ESC[6n on one primary 80x24 screen; the independent expectation ESC[1;3R comes from the confirmed core reply contract.

- raw fixed-ConPTY silent control: conhost does not answer the child itself; the child observes its bounded timeout only
- raw fixed-ConPTY distinct-reply control: host-written bytes reach the real child unchanged
- product SessionModel path: parsed query at transport offset 23, core reply written back through the shared input queue, real child receives exactly ESC[1;3R with matching PID and verified cleanup

No product behavior, default entry or query support is changed. DA1 stays strict-only/recovery-silent; DA2/OSC remain unimplemented.

Co-authored-by: JavaZeroo <71128095+JavaZeroo@users.noreply.github.com>
Record the bounded formal Qt / fixed-ConPTY query-reply evidence: core contract, raw ConPTY silent/distinct controls, SessionModel write-back and real-child receipt, plus exact bytes, child identity, cleanup and limitations.

Also point the earlier Vim trajectory parenthetical about conhost answering DSR to the corrected observation without rewriting the original record.

Co-authored-by: JavaZeroo <71128095+JavaZeroo@users.noreply.github.com>
Build qt_query_reply_test, record its runtime manifest, and include qt_query_reply in the existing offscreen CTest selection so the new evidence is reproducible in CI.

Co-authored-by: JavaZeroo <71128095+JavaZeroo@users.noreply.github.com>
query_offset=23 is the start of the fixed 6-byte source AB+ESC[6n; the ESC[6n sequence itself starts at zero-based byte 25 (AB occupies 23/24). Clarify the README, EVIDENCE row and validation prose only. Raw transport hex, historical results, schema/field names and product/test logic are unchanged.

Co-authored-by: JavaZeroo <71128095+JavaZeroo@users.noreply.github.com>
@JavaZeroo
JavaZeroo merged commit 87580cd into main Nov 8, 2026
10 of 11 checks passed
JavaZeroo-Bot added a commit that referenced this pull request Nov 12, 2026
…ecord-hidden-retention-2e7373117ea0

Union both sides: keep the bounded autoscroll Qt target/CTest entry and
the #324 system paste, #333 BCD fixtures, #330/#331 packaging and
#328 eight-session capabilities with their assertions.

Co-authored-by: JavaZeroo <71128095+JavaZeroo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants